package com.dubbo.cp.provider.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.dubbo.cp.entity.ClassroomEntity;

@Mapper
public interface ClassroomMapper {
	
	
	@Select("select * from classroom where id = #{id}")
	public ClassroomEntity findClassroomByClassroomid(@Param("id")int id);

	@Select("select * from classroom where 1 = 1")
	public List<ClassroomEntity> getClassroomList();
	
	@Select("select * from classroom where classroomName = #{classroomName}")
	public ClassroomEntity findClassroomByClassroomName(@Param("classroomName")String classroomName);
	
	@Insert("insert into classroom(classroomName) values(#{classroomName})")
	public void insertClassroomEntity(ClassroomEntity classroomEntity);
	
	
	@Delete("delete from classroom where id = #{id}")
	public void deleteById(int id);
	
	@Update("update classroom set classroomName = #{classroomName} where id = #{id}")
	public void UpdateClassroomEntity(ClassroomEntity classroomEntity);
	
	@Select("select * from classroom limit #{arg0},#{arg1} ")
	public List<ClassroomEntity>getClassroomByPage(int start, int size);
}
